<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>生成邀请码</title>

    <script th:src="@{js/jquery/2.0.0/jquery.min.js}" src="js/jquery/2.0.0/jquery.min.js"></script>
    <link th:href="@{../css/bootstrap/3.3.6/bootstrap.min.css}" href="css/bootstrap/3.3.6/bootstrap.min.css"
          rel="stylesheet"/>
    <script th:src="@{js/bootstrap/3.3.6/bootstrap.min.js}" src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
    <script type="text/javascript" th:src="@{js/private.js}"></script>
</head>
<body>
<div class="container">
    <div th:replace="head::header"></div>

    <div class="row">


        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingOne">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne"
                       aria-expanded="false"
                       aria-controls="collapseOne">
                        邀请码管理
                    </a>
                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-xs-2">
                            <h4 class="text-success">邀请码列表</h4>
                        </div>
                        <div class="col-xs-3 pull-right">
                            <button class="btn btn-primary " id="generateCode">生成邀请码</button>
                        </div>
                    </div>


                    <table class="table table-striped table-bordered table-hover table-condensed">
                        <thead>
                        <th>邀请码</th>
                        <th>生成时间</th>
                        <th>激活状态</th>
                        <th>用户</th>
                        <th>操作</th>
                        </thead>
                        <tbody id="codeList">
                        <tr th:each="code:${inviteList}">
                            <td th:text="${code.icode}">3463464236345</td>
                            <td th:text="${#dates.format(code.icreatetime,'yyyy-MM-dd HH:mm:ss')}">2019-02-05-08:00:00
                            </td>
                            <td th:class="${code.istate==1}?text-primary:false" class="text-primary"
                                th:text="${code.istate==1}?|已激活|:|未激活|">已激活
                            </td>
                            <td th:text="${code.user==null}?|&nbsp;|:${code.user.uname}">yyy</td>
                            <td><a th:href="|/deleteCode/${code.icode}|">删除</a></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>


        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingTwo">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"
                       aria-expanded="false"
                       aria-controls="collapseTwo">
                        用户管理
                    </a>
                </h4>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingTwo">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-xs-2">
                            <h4 class="text-success">用户列表</h4>
                        </div>
                    </div>


                    <table class="table table-striped table-bordered table-hover  table-condensed">
                        <thead>
                        <th>用户id</th>
                        <th>用户名</th>
                        <th>创建时间</th>
                        <th>状态</th>
                        <th>操作</th>
                        </thead>
                        <tbody>
                        <tr th:each="user:${userList}">
                            <td th:text="${user.uid}">1</td>
                            <td th:text="${user.uname}">xxx</td>
                            <td th:text="${#dates.format(user.ucreatetime,'yyyy-MM-dd HH:mm:ss')}">2019-02-05-08:00:00
                            </td>
                            <td th:text="${user.ustate== 1}?|正常|:|禁言|">正常</td>
                            <td><a href="#" th:text="${user.level== 1}?(${user.ustate== 1}?|禁言|:|解禁|):|&nbsp;|"
                                   th:onclick="${user.ustate== 1}?|banUser(${user.uid})|:|unbanUser(${user.uid})|">禁言</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>


                </div>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingTwo">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"
                       aria-expanded="false"
                       aria-controls="collapseTwo">
                        上传文件管理【虚假功能，我没写后台业务】
                    </a>
                </h4>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingTwo">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-xs-2">
                            <h4 class="text-success">文件列表</h4>
                        </div>
                    </div>


                    <table class="table table-striped table-bordered table-hover  table-condensed">
                        <thead>
                        <th>文件名</th>
                        <th>上传用户名</th>
                        <th>上传时间</th>
                        <th>状态</th>
                        <th>操作</th>
                        </thead>
                        <tbody>
                        <tr>
                            <td>test.zip</td>
                            <td>xxx</td>
                            <td>2019-02-05-08:00:00</td>
                            <td>已被用户删除</td>
                            <td><a href="#">下载</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">删除文件</a></td>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>xxx</td>
                            <td>2019-02-05-08:00:00</td>
                            <td>存在</td>
                            <td><a href="#">下载</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">删除文件</a></td>
                        </tr>
                        </tbody>
                    </table>


                </div>
            </div>
        </div>

    </div>
</div>


</body>

</html>
